//
//  JMBrand.m
//  OpenSesame
//
//  Created by 张家铭 on 16/1/3.
//  Copyright © 2016年 OpenSesame. All rights reserved.
//

#import "JMBrand.h"
#import "JMCar.h"
#import "WDCar.h"

@implementation JMBrand
+ (instancetype)brandWithDic:(NSDictionary *)dic{
    return [[self alloc] initWithDic:dic];
}

- (instancetype)initWithDic:(NSDictionary *)dic{
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dic];
        NSMutableArray *carArr = [NSMutableArray array];
        for (NSDictionary *dict in self.models) {
            JMCar *car = [JMCar carWithDic:dict];
            [carArr addObject:car];
            
//            WDCar *car = [WDCar carWithDic:dict];
//            [carArr addObject:car];
        }
        self.models = carArr;
    }
    return self;
}
@end
